<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = [
            {
                "MatchKOCacheID": 28754017,
                "Country": "英格兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024西安大奖赛",
                "KOId": "KO0000079637",
                "MatchID": "MI0000000558",
                "PlayerId": "PL0000000099",
                "TotalKoCount": "9           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "08-23",
                "MatchTimeDaySec": "08-23 14:00",
                "MatchTime": "2024/8/23 14:00:00",
                "GroupCode": "A           ",
                "RoundCode": "8           ",
                "PlayRank": "5           ",
                "VsPlayRank": "37          ",
                "PlayerNm_C": "罗尼·奥沙利文                                    ",
                "PlayerNm_E": "Ronnie O'Sullivan                                 ",
                "defaultPicUrl": "PlayerPic/PL000000009920211212罗尼·奥沙利文_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000008720211214马修·塞尔特.jpg",
                "PlayerNm_C_Vs": "马修·塞尔特                                      ",
                "PlayerNm_E_Vs": "Matthew Selt                                      ",
                "VsPlayerId": "PL0000000087",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754042,
                "Country": "英格兰",
                "Country_Vs": "中国",
                "CompeteTitle": "2024西安大奖赛",
                "KOId": "KO0000079606",
                "MatchID": "MI0000000558",
                "PlayerId": "PL0000000371",
                "TotalKoCount": "9           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "08-23",
                "MatchTimeDaySec": "08-23 14:00",
                "MatchTime": "2024/8/23 14:00:00",
                "GroupCode": "A           ",
                "RoundCode": "8           ",
                "PlayRank": "3           ",
                "VsPlayRank": "58          ",
                "PlayerNm_C": "凯伦·威尔逊                                      ",
                "PlayerNm_E": "Kyren Wilson                                      ",
                "defaultPicUrl": "PlayerPic/PL000000037120211212凯伦·威尔逊_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000127420211218徐思.jpg",
                "PlayerNm_C_Vs": "徐思                                              ",
                "PlayerNm_E_Vs": "Xu Si                                             ",
                "VsPlayerId": "PL0000001274",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754021,
                "Country": "英格兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024西安大奖赛",
                "KOId": "KO0000079669",
                "MatchID": "MI0000000558",
                "PlayerId": "PL0000000134",
                "TotalKoCount": "9           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "08-23",
                "MatchTimeDaySec": "08-23 19:30",
                "MatchTime": "2024/8/23 19:30:00",
                "GroupCode": "A           ",
                "RoundCode": "8           ",
                "PlayRank": "0           ",
                "VsPlayRank": "0           ",
                "PlayerNm_C": "贾德·特鲁姆普                                    ",
                "PlayerNm_E": "Judd Trump                                        ",
                "defaultPicUrl": "PlayerPic/PL000000013420211212贾德·特鲁姆普_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000004120211214大卫·吉尔伯特.jpg",
                "PlayerNm_C_Vs": "大卫·吉尔伯特                                    ",
                "PlayerNm_E_Vs": "David Gilbert                                     ",
                "VsPlayerId": "PL0000000041",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753960,
                "Country": "威尔士",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024西安大奖赛",
                "KOId": "KO0000079700",
                "MatchID": "MI0000000558",
                "PlayerId": "PL0000000140",
                "TotalKoCount": "9           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "08-23",
                "MatchTimeDaySec": "08-23 19:30",
                "MatchTime": "2024/8/23 19:30:00",
                "GroupCode": "A           ",
                "RoundCode": "8           ",
                "PlayRank": "66          ",
                "VsPlayRank": "15          ",
                "PlayerNm_C": "丹尼尔·维尔斯                                    ",
                "PlayerNm_E": "Daniel Wells                                      ",
                "defaultPicUrl": "PlayerPic/PL00000001402009-12-2sp.gif",
                "defaultPicUrl_Vs": "PlayerPic/PL000000004020211212巴里·霍金斯_compressed.jpg",
                "PlayerNm_C_Vs": "巴里·霍金斯                                      ",
                "PlayerNm_E_Vs": "Barry Hawkins                                     ",
                "VsPlayerId": "PL0000000040",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753950,
                "Country": "威尔士",
                "Country_Vs": "马来西亚",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083479",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000043",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "9           ",
                "VsPlayRank": "85          ",
                "PlayerNm_C": "马克·威廉姆斯                                    ",
                "PlayerNm_E": "Mark Williams                                     ",
                "defaultPicUrl": "PlayerPic/PL000000004320211212马克·威廉姆斯_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000042420181002THOR CHUAN LEONG涂振龙.jpg",
                "PlayerNm_C_Vs": "涂振龙                                            ",
                "PlayerNm_E_Vs": "Thor Chuan Leong                                  ",
                "VsPlayerId": "PL0000000424",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753929,
                "Country": "苏格兰",
                "Country_Vs": "苏格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083490",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000002",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "16          ",
                "VsPlayRank": "75          ",
                "PlayerNm_C": "约翰·希金斯                                      ",
                "PlayerNm_E": "John Higgins                                      ",
                "defaultPicUrl": "PlayerPic/PL000000000220211212约翰·希金斯_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000037620181002ROSS MUIR.jpg",
                "PlayerNm_C_Vs": "罗斯·缪尔                                        ",
                "PlayerNm_E_Vs": "Ross Muir                                         ",
                "VsPlayerId": "PL0000000376",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753916,
                "Country": "北爱尔兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083542",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000031",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "1           ",
                "VsPlayRank": "11          ",
                "PlayerNm_C": "马克·艾伦                                        ",
                "PlayerNm_E": "Mark Allen                                        ",
                "defaultPicUrl": "PlayerPic/PL000000003120211213马克·艾伦.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000037020240716Gary Wilson.jpg",
                "PlayerNm_C_Vs": "加里·威尔森                                      ",
                "PlayerNm_E_Vs": "Gary Wilson                                       ",
                "VsPlayerId": "PL0000000370",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753986,
                "Country": "英格兰",
                "Country_Vs": "比利时",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083599",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000371",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "3           ",
                "VsPlayRank": "111         ",
                "PlayerNm_C": "凯伦·威尔逊                                      ",
                "PlayerNm_E": "Kyren Wilson                                      ",
                "defaultPicUrl": "PlayerPic/PL000000037120211212凯伦·威尔逊_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000149720220519Julien Leclercq.jpg",
                "PlayerNm_C_Vs": "朱利安·勒克莱克                                  ",
                "PlayerNm_E_Vs": "Julien Leclercq                                   ",
                "VsPlayerId": "PL0000001497",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753978,
                "Country": "英格兰",
                "Country_Vs": "-=请选择国家=-",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083584",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000040",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "15          ",
                "VsPlayRank": "95          ",
                "PlayerNm_C": "巴里·霍金斯                                      ",
                "PlayerNm_E": "Barry Hawkins                                     ",
                "defaultPicUrl": "PlayerPic/PL000000004020211212巴里·霍金斯_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000132020220119Liam Davies.jpg",
                "PlayerNm_C_Vs": "利亚姆·戴维斯                                    ",
                "PlayerNm_E_Vs": "Liam Davies                                       ",
                "VsPlayerId": "PL0000001320",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754001,
                "Country": "英格兰",
                "Country_Vs": "匈牙利",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083494",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000014",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "10          ",
                "VsPlayRank": "111         ",
                "PlayerNm_C": "阿里斯特·卡特                                    ",
                "PlayerNm_E": "Allister Carter                                   ",
                "defaultPicUrl": "PlayerPic/PL000000001420211214阿里斯特·卡特.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000302920231207Bulcsu Revesz.jpg",
                "PlayerNm_C_Vs": "布尔苏·雷维斯                                    ",
                "PlayerNm_E_Vs": "Bulcsu Revesz                                     ",
                "VsPlayerId": "PL0000003029",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753994,
                "Country": "英格兰",
                "Country_Vs": "泰国",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083505",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000099",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "5           ",
                "VsPlayRank": "94          ",
                "PlayerNm_C": "罗尼·奥沙利文                                    ",
                "PlayerNm_E": "Ronnie O'Sullivan                                 ",
                "defaultPicUrl": "PlayerPic/PL000000009920211212罗尼·奥沙利文_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000307720230725m Phetmalaikul.jpg",
                "PlayerNm_C_Vs": "马纳萨温·佩特玛莱库                              ",
                "PlayerNm_E_Vs": "Manasawin Phetmalaikul                            ",
                "VsPlayerId": "PL0000003077",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754036,
                "Country": "英格兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083588",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000003",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "7           ",
                "VsPlayRank": "74          ",
                "PlayerNm_C": "肖恩·墨菲                                        ",
                "PlayerNm_E": "Shaun Murphy                                      ",
                "defaultPicUrl": "PlayerPic/PL000000000320211212肖恩·墨菲_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000035420181016IAN BURNS伯恩斯.jpg",
                "PlayerNm_C_Vs": "伯恩斯                                            ",
                "PlayerNm_E_Vs": "Ian Burns                                         ",
                "VsPlayerId": "PL0000000354",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754033,
                "Country": "英格兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083557",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000401",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "14          ",
                "VsPlayRank": "61          ",
                "PlayerNm_C": "杰克·琼斯                                        ",
                "PlayerNm_E": "Jak Jones                                         ",
                "defaultPicUrl": "PlayerPic/PL000000040120211215杰克·琼斯.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000041120181016桑德森·林Sanderson Lam.jpg",
                "PlayerNm_C_Vs": "林杉峰                                            ",
                "PlayerNm_E_Vs": "Sanderson Lam                                     ",
                "VsPlayerId": "PL0000000411",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754031,
                "Country": "英格兰",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083536",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000134",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "2           ",
                "VsPlayRank": "17          ",
                "PlayerNm_C": "贾德·特鲁姆普                                    ",
                "PlayerNm_E": "Judd Trump                                        ",
                "defaultPicUrl": "PlayerPic/PL000000013420211212贾德·特鲁姆普_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000005120220308Robert Milkins.jpg",
                "PlayerNm_C_Vs": "罗伯特·米尔金斯                                  ",
                "PlayerNm_E_Vs": "Robert Milkins                                    ",
                "VsPlayerId": "PL0000000051",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28753962,
                "Country": "威尔士",
                "Country_Vs": "英格兰",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083525",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000011",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "18          ",
                "VsPlayRank": "73          ",
                "PlayerNm_C": "瑞恩·戴                                          ",
                "PlayerNm_E": "Ryan Day                                          ",
                "defaultPicUrl": "PlayerPic/PL000000001120211214瑞恩·戴.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000136920190614Louis Heathcote.jpg",
                "PlayerNm_C_Vs": "路易希·斯考特                                    ",
                "PlayerNm_E_Vs": "Louis Heathcote                                   ",
                "VsPlayerId": "PL0000001369",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            },
            {
                "MatchKOCacheID": 28754053,
                "Country": "英格兰",
                "Country_Vs": "中国",
                "CompeteTitle": "2024英国公开赛",
                "KOId": "KO0000083510",
                "MatchID": "MI0000000559",
                "PlayerId": "PL0000000005",
                "TotalKoCount": "7           ",
                "Wins": "0           ",
                "VsWins": "0           ",
                "SortMatchTime": "09-23",
                "MatchTimeDaySec": "09-23 17:00",
                "MatchTime": "2024/9/23 17:00:00",
                "GroupCode": "A           ",
                "RoundCode": "128         ",
                "PlayRank": "6           ",
                "VsPlayRank": "29          ",
                "PlayerNm_C": "马克·塞尔比                                      ",
                "PlayerNm_E": "Mark Selby                                        ",
                "defaultPicUrl": "PlayerPic/PL000000000520211212塞尔比_compressed.jpg",
                "defaultPicUrl_Vs": "PlayerPic/PL000000135320211216庞俊旭.jpg",
                "PlayerNm_C_Vs": "庞俊旭                                            ",
                "PlayerNm_E_Vs": "pang junxu                                        ",
                "VsPlayerId": "PL0000001353",
                "CURRANK": "2024-07-04  ",
                "ReplyCount": 0,
                "LikeCount": 0
            }
        ]
        function trims(str) {
            return str.trim()
            // return str.replace(/\s+/g, '')
        }

        const data = arr.map(i => ({
            "MatchKOCacheID": i.MatchKOCacheID + '',
            "MatchTime": i.MatchTime,
            "RoundCode": i.RoundCode,
            "PlayRank": i.PlayRank,
            "VsPlayRank": i.VsPlayRank,
            "PlayerNm_C": i.PlayerNm_C,
            "PlayerNm_C_Vs": i.PlayerNm_C_Vs,
        })).map(j => {
            for (const key in j) {
                if (Object.prototype.hasOwnProperty.call(j, key)) {
                    const element = j[key];
                    j[key] = trims(element)
                }
            }
            return j
        })
        console.log(data);
        function groupByYear(data) {
            return data.reduce((groups, item) => {
                const year = item.MatchTime;
                if (!groups[year]) {
                    groups[year] = [];
                }
                groups[year].push(item);
                return groups;
            }, {});
        }
        const fenleidata = groupByYear(data)
        console.log(fenleidata);
        // 打印结果
        for (const year in fenleidata) {
            console.log(`Year ${year}:`);
            // console.log(fenleidata[year]);
            const item = fenleidata[year]
            const datastr = item.map(i => {
                const str = `[${i.PlayRank}]${i.PlayerNm_C}vs${i.PlayerNm_C_Vs}[${i.VsPlayRank}]`
                return str
            }).join('， ')
            console.log(datastr);

        }
    </script>
</body>

</html>